package com.huanletao.event;

import org.apache.commons.lang3.event.EventListenerSupport;
import org.apache.commons.lang3.event.EventUtils;

/**
 * <p>
 *
 * </p>
 *
 * @package: com.huanletao.event
 * @description:
 * @className: Main
 * @author: @踏雪无痕
 * @date: Created in 2022/5/31
 * @copyright: Copyright (c) 2022/5/31
 * @version: V1.0
 */
public class Main {
    public static void main(String[] args) {
       // EventListenerSupport<IListeners> listenersEvent = new EventListenerSupport<>(IListeners.class);

        EventListenerSupport<IListeners> listenersEvent = EventListenerSupport.create(IListeners.class);

        // 注册监听
        listenersEvent.addListener(new Courier("快递员小马"));
        listenersEvent.addListener(new User("用户小刘"));
        listenersEvent.addListener(new ThirdParty("第三方公司"));

        //发布事件;
        listenersEvent.fire().receive();
    }
}
